package com.smbms.service.provider;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.smbms.dao.provider.ProviderMapper;
import com.smbms.entity.Provider;
@Service("provider")
public class ProviderServiceImpl implements ProviderService{
	
	@Resource
	private ProviderMapper providerMapper;
	
	@Override
	public boolean add(Provider provider) {
		if(providerMapper.add(provider)>0){
			return true;
		}
		return false;
	}

	@Override
	public List<Provider> getProviderList(String proName, String proCode,Integer fromIndex,Integer pageSize) {
		
		return providerMapper.getProviderList(proName, proCode, fromIndex, pageSize);
	}

	@Override
	public boolean deleteProviderById(int delId) {
		if(providerMapper.deleteProviderById(delId)>0){
			return true;
		}
		return false;
	}

	@Override
	public Provider getProviderById(int id) {
		
		return providerMapper.getProviderById(id);
	}

	@Override
	public boolean modify(Provider provider) {
		if(providerMapper.modify(provider)>0){
			return true;
		}
		return false;
	}

	@Override
	public List<Provider> findProviderAll() {
		return providerMapper.findProviderAll();
	}

	@Override
	public int count(String proName, String proCode) {
		return providerMapper.count(proName, proCode);
	}
	
	
	
	
}
